﻿using System;
using System.Windows;
using KeyStone.EventHub;

namespace TestHarness2
{
   /// <summary>
   /// Interaction logic for MainWindow.xaml
   /// </summary>
   public partial class MainWindow : Window
   {
 

      public MainWindow()
      {
         InitializeComponent();
         EventHub.Subscribe<ConnectionState>(Callback);
         ConnectionState state = new ConnectionState("127.0.0.10", 8080);
        
         EventHub.Publish<ConnectionState>(state);         

         Console.WriteLine("Finished");

      }

      public void Callback(ConnectionState state)
      {
         Console.WriteLine(state.Address);
      }

   }



   public class ConnectionState : Payload
   {
      public string Address { get; set; }
      public int Port { get; set; }

      public ConnectionState(string address, int port)
      {
         Address = address;
         Port = port;
      }
   }
 
}
